<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
    <style>
      .container {
        display: grid;
        grid-template-columns: repeat(12, 1fr);
        grid-template-rows: 50px 400px 50px;
        grid-template-areas:
          "h h h h h h h h h h h h"
          "m m c c c c c c c c c c"
          "f f f f f f f f f f f f";
      }
      .header {
        grid-area: h;
        background-color: red;
      }
      .menu {
        grid-area: m;
        background-color: green;
      }
      .content {
        grid-area: c;
        background-color: pink;
      }
      .footer {
        grid-area: f;
        background-color: blue;
      }
      @media (max-width: 768px) {
        .container {
          grid-template-areas:
            "h h h h h h m m m m m m"
            "c c c c c c c c c c c c"
            "f f f f f f f f f f f f";
        }
      }
    </style>
  </head>
  <body>
    <div class="container">
      <div class="header">头部</div>
      <div class="menu">菜单栏</div>
      <div class="content">内容展示</div>
      <div class="footer">底部</div>
    </div>
  </body>
</html>
